package jicheng;

//人类  父类
class Person{
	String name;
	int age;
	
	//没有默认构造
	public Person(){ }
	
	public Person(String name){
		System.out.println("人类构造");
	}
	
	public void eat(){
		System.out.println(name+"吃饱了");
	}
}

class Teacher extends Person{
	double money;  //薪水
	
	public Teacher(String name,double mm){
		// 自动调用无参数的构造    没有，报错
		// 主动调用父类构造
		super(name);
		this.money = mm;
		
	}
	
	public void teach(){
		System.out.println(name+"上课很累....");
	}
}

class Student  extends Person{
	int grade;  //成绩
	
	Student(String name){
					  // 自动调用无参数的构造
		super(name);  // 主动调用父类构造
		System.out.println("学生构造");
	}
	
	public void test(){
		System.out.println(name+"考试必及格");
	}
} 

public class Test1 {

	public static void main(String[] args) {
		
		Student temo=new Student("张三");
		 

	}

}
